home *** CD-ROM | disk | FTP | other *** search
- /* File : upcoming.rexx
- *
- * $Project: DateBookIV
- *
- * $Description: Script to produce the same output as
- * DateBook mode=CLI, through the rexx
- * port of a resident server.
- *
- * $Module Id:
- * $Original Author: Robert Hardy
- * $Date Started: Thu Feb 1 1996
- *
- * $Header$
- *
- * $Revision$
- *
- * $State$
- *
- * $Locker$
- *
- * $Log$
- *
- *
- */
-
-
-
- OPTIONS RESULTS
-
- port_name = 'datebook_rx'
- port_off = 0
-
- if ~show('p', port_name) then do /* Find out if DateBook is running */
-
- port_off = 1 /* Set the flag for cleanup on exit */
-
- address command 'run datebook RXPORT 'port_name' MODE SERVER'
- address command 'waitforport 'port_name /* Wait till it's loaded */
-
- if ~show('p', port_name) then do /* Find out if it ran */
- say "Can't find Datebook??"
- exit 5
- end
- end
-
- address VALUE port_name
-
- /* Ask Datebook for today's date */
- 'getfield $C'
- today = strip(translate(result, '', '"'))
-
- /* convert packed date to human readable form */
- EXPANDDATE today
- today = result
-
- /* ask for the report */
- 'UPCOMING UPDATE'
- if rc = 0 then do /* only print if there is a report */
- report = result
-
- say 'Upcoming On: 'today''
- say
- say report
- end
-
- if port_off then 'shutdown' /* If we started the server we should
- * also close it.
- */
- exit 0
-